
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['UserStory', 'Anzahl'],
          <% UserStoryState.all.each do |state| %>
          	['<%= state.status %>',<%= UserStory.where(user_story_state_pid: state.id, product_backlog_pid: ProductBacklog.find_or_create_by_project_pid(current_user.project_id).id).count %>],
          <% end %>
        ]);

        var options = {
          title: 'UserStories'
        };

        var chart = new google.visualization.PieChart(document.getElementById('wrapChart'));
        chart.draw(data, options);
      }
    </script>